/**
 * @Project Name:hoofungson-elk-log
 * @Package Name:cn.hoofungson.framework.elk.log.config
 * @Since JDK 1.8
 */

package cn.hoofungson.framework.elk.log.config;

import cn.hoofungson.framework.elk.log.domain.AppInfo;
import cn.hoofungson.framework.elk.log.properties.LogProperties;
import cn.hoofungson.framework.elk.log.util.AppInfoUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * @Description: 日志配置
 * @Author 胡松 hoofungson@163.com
 * @Date 2019-08-23 16:26
 * @Version V1.0
 */
@Component
@Configuration
public class LogConfig {

    @Autowired
    private LogProperties logProperties;

    @Bean
    public AppInfo appInfo() {
        AppInfoUtils.setAppInfo(new AppInfo(this.logProperties.getAppId(), this.logProperties.getPort(), this.logProperties.getContentFormat(), this.logProperties.getFilePath(), this.logProperties.getNetCardName()));
        return AppInfoUtils.getAppInfo();
    }

}
